package com.howard.modules.base.service.impl;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;

import com.howard.modules.base.dao.AppBaseDao;
import com.howard.modules.base.paging.Paging;
import com.howard.modules.base.service.AppBaseService;

public abstract class AppBaseServiceImpl<T extends Serializable> implements AppBaseService<T> {

    /** 日志对象 */
    protected Logger logger = Logger.getLogger(this.getClass());

    public abstract AppBaseDao<T> getDao();

	public int count() {
		return getDao().count();
	}
	
	public int count(String str, Map<String, String> values) {
		return getDao().count(str, values);
	}
	
	public List<T> getList() {
		return getDao().getList();
	}

	public List<T> getList(Paging page) {
		return getDao().getList(page);
	}

	public List<T> getList(String str, Map<String, String> values) {
		return getDao().getList(str, values);
	}

	public List<T> getList(String str, Map<String, String> values, Paging page) {
		return getDao().getList(str, values, page);
	}

	public T load(String id) {
		return getDao().load(id);
	}
	
	public T load(int id) {
		return getDao().load(id);
	}
	
	public void merge(T t) {
		getDao().merge(t);
	}
	
	public void save(T t) {
		getDao().save(t);
	}
	
	public void saveOrUpdate(T t) {
		getDao().saveOrUpdate(t);
	}
	
	public void update(T t) {
		getDao().update(t);
	}
	
	public void delete(T t) {
		getDao().delete(t);
	}

	public void deleteAll() {
		getDao().deleteAll();
	}

	public void deleteById(String id) {
		getDao().deleteById(id);
	}


}
